<template>
	<wd-popup v-model="show" position="bottom" :safe-area-inset-bottom="true" custom-style="height: 600rpx;">
		<wd-cell-group>
			<wd-cell title="评价" :label="data.comment_content"></wd-cell>
			<wd-cell title="评价要求" :label="data.describe_content"></wd-cell>
			<wd-cell title="图片">
				<template #label>
					<view class="grid-box">
						<wd-img
							v-for="(item, index) in data.image_list"
							:key="`image${index}`"
							:src="item"
							:width="50"
							:height="50"
						></wd-img>
					</view>
				</template>
			</wd-cell>
		</wd-cell-group>
	</wd-popup>
</template>
<script setup>
import { http } from '@/utils/http'

const show = ref(false)
const cid = ref('')
const data = ref(null)

const showPopup = async (id) => {
	show.value = true
	cid.value = id

	let res = await http.get('/Usersd/commentDataDetails', { cid: cid.value })
	if (res.code == 200) {
		data.value = res.result

		// 下载图片
		// data.value.image_list.map((item) => {})
		navigator.share({
			title: '刷单',
			text: data.value.comment_content,
		})

		// 复制评价
		uni.setClipboardData({
			data: data.value.comment_content,
		})
	}
}

defineExpose({ showPopup })
</script>
<style lang="scss" scoped></style>
